package br.com.financeiro;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;
import android.widget.Toast;

public class MainActivity extends Activity {
	ImageButton tipoConta,listagemTipoConta, conta,listagem,listagemConta;
    
	@Override
   protected void onCreate(Bundle savedInstanceState) {
        
    	super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
        tipoConta = (ImageButton) findViewById(R.id.imageButton1);
        tipoConta.setOnClickListener(new OnClickListener(){
        	public void onClick(View v){
        		Intent tipoContaIntent = new Intent(MainActivity.this,ContaActivity.class);
        		startActivity(tipoContaIntent);
        	}
        });
        
        conta = (ImageButton) findViewById(R.id.imageButton2);
        conta.setOnClickListener(new OnClickListener() {	
			@Override
			public void onClick(View arg0) {
				Intent contaIntent = new Intent(MainActivity.this,TipoContaActivity.class);
				startActivity(contaIntent);
			}
		});
        
        listagem = (ImageButton) findViewById(R.id.imageButton3);
        listagem.setOnClickListener(new OnClickListener() {
        	
        	@Override
        	public void onClick(View arg0) {
        		Intent listagemIntent = new Intent(MainActivity.this,BuscarContaPeridoActivity.class);
        		startActivity(listagemIntent);
        	}
        });        
 
        listagem = (ImageButton) findViewById(R.id.imageButton4);
        listagem.setOnClickListener(new OnClickListener() {
        	
        	@Override
        	public void onClick(View arg0) {
        		finish();
        	}
        });        
    }
	
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }
    
    @Override
    public boolean onOptionsItemSelected(MenuItem item) {

      switch (item.getItemId()) {
      case R.id.menu_exit:
        finish();
        break;
      case R.id.menu_refresh:
        Toast toast = Toast.makeText(this, "Atualizando os dados...",
            Toast.LENGTH_LONG);
        toast.show();
        break;

      case R.id.menu_export:
        //exportar();
        break;

      default:
        break;
      }

      return super.onOptionsItemSelected(item);
    }
}
